import request from '@/utils/request'

export function upload(url, file) {
  return new Promise((resolve, reject) => {
    request.post(url, file).then(result => {
      if (result) {
        resolve(result)
      } else {
        reject(result)
      }
    }).catch(res => {
      reject(res)
    })
  })
}
